﻿using System.Web.Security;

namespace AspNetMvc.Providers
{
   public abstract class OpenIdMembershipProvider : MembershipProvider
   {
      /// <summary>
      /// Creates the user 
      /// </summary>
      /// <param name="username">Username</param>
      /// <param name="password">Password</param>
      /// <param name="openIdURL">OpenId URL</param>
      /// <returns></returns>
      public abstract MembershipUser CreateUser(string username, string openIdUrl, IOpenIdUserInfo info, string lang, out MembershipCreateStatus status);

      public abstract MembershipUser CreateUser(string username, string password, string email, string lang, string confirmationLinkFormat, object providerUserKey, out MembershipCreateStatus status);

      public abstract MembershipUser ApproveUser(string confirmationKey);

      /// <summary>
      /// Returns the username from its associated openid
      /// </summary>
      /// <param name="openIdUrl">OpenId Url</param>
      /// <returns></returns>
      public abstract MembershipUser GetUser(string openIdUrl, IOpenIdUserInfo info);

      public abstract bool ValidateUser(string openIdURL, IOpenIdUserInfo info);

      public abstract string GetUsernameFromOpenId(string openId, IOpenIdUserInfo info);
   }
}